package com.hzdl.service;

import com.hzdl.bean.Project;
import com.hzdl.dao.ProjectDao;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * create by lzf on 2018\9\5 0005
 */
@Service
public class ProjectService  {
@Autowired
private ProjectDao dao;

    public void addProject(Project project) {
        dao.addProject(project);
    }

    public List<Project> getAllProjects() {
        List<Project> projects = dao.getAllProjects();
        return projects;
    }

    public boolean updateProject(String pname, int company, String address,long id ) {
        dao.updateProject(pname,company,address,id);
        return true;
    }
    public Project getProjectById(long id){
        return dao.getProjectById(id);
    }

    public List<Project> getAllProjectsByC(int company) {
        List<Project> newprojects = dao.getAllProjectsByC(company);
        return newprojects;
    }
}
